#pragma once
#include "BaseProtocol.h"
#include "DBProtocol.h"

enum LW_Msg_Id
{
	Msg_LW_User_Login = Msg_Base_LS_WS + 1,
	Msg_WL_User_SignInfo = Msg_Base_LS_WS + 101,
};

class LWUserLoginMsg : public Msg
{
public:
	DWORD GetMsgId(){return Msg_LW_User_Login;}
	DWORD GetLength(){return sizeof(m_dwUserId);
	}

	BOOL Read( CSocketStream& iStream );
	BOOL Write( CSocketStream& oStream ) const;
public:
	DWORD m_dwUserId;
};

struct UserSignupInfo
{
	DWORD dwProductId;
	DWORD tmMatchStartTime;
};

class WLUserSignupInfoMsg : public Msg
{
public:
	DWORD GetMsgId(){return Msg_WL_User_SignInfo;}
	DWORD GetLength(){
		int nCount = m_listSignupInfo.GetCount();
		int nLength = sizeof(m_dwUserId) + sizeof(nCount) + nCount * sizeof(UserSignupInfo);
		return nLength;
	}

	BOOL Read( CSocketStream& iStream );
	BOOL Write( CSocketStream& oStream ) const;
public:
	DWORD m_dwUserId;
	CObjList<UserSignupInfo> m_listSignupInfo;
};
